var ajax_url = 'index.php?m=region';

$(function(){
	//初始化树
	$('#page_tree').ajaxTree({
		url : ajax_url+'&p=get',
		data : function(node){  return { id : node.attr("id").substr(0, 5) == 'node_' ? node.attr("id").substr(5) : 0 };  },
		check : node_check
	});

});

function node_check(node){
	var region_id = node.attr("id").substr(5);
	var region_name = node.find("a:first").text();
	var action = node.find(':checkbox:first').attr('checked');
	change_region(region_id,region_name,action);
}